import Mock from 'mockjs'

export default ({
  mock
}) => {
  if (!mock) return
  Mock.mock('/api/carousel/1', 'get', {
    code: 0,
    data: [{
      img: Mock.Random.image('1000x270', Mock.Random.hex(), '@word(5, 8)'),
      title: '书单：科技赋能',
      path: '#'
    }, {
      img: Mock.Random.image('1000x270', Mock.Random.hex(), '@word(5, 8)'),
      title: '书单：亲子书目精选',
      path: '#'
    }, {
      img: Mock.Random.image('1000x270', Mock.Random.hex(), '@word(5, 8)'),
      title: '书单：神奇博物馆',
      path: '#'
    }, {
      img: Mock.Random.image('1000x270', Mock.Random.hex(), '@word(5, 8)'),
      title: '书单：优秀译本精选',
      path: '#'
    }, {
      img: Mock.Random.image('1000x270', Mock.Random.hex(), '@word(5, 8)'),
      title: '拍卖：九九典藏三连拍',
      path: '#'
    }],
    msg: ''
  })

  Mock.mock('/api/exhibition', 'get', {
    code: 0,
    'data|8': [{
      title: '@cword(5, 8)',
      path: '#',
      img: Mock.Random.image('1000x80', Mock.Random.hex())
    }],
    msg: ''
  })

  Mock.mock('/api/getGoodBook/share', 'get', {
    code: 0,
    'data|12': [{
      id: '@increment',
      title: '@cword(3, 8)',
      author: '@cword(3, 5)',
      price: '@natural(10, 100)',
      img: '@image(515x800)'
    }],
    msg: ''
  })

  Mock.mock('/api/getNewBook', 'get', {
    code: 0,
    data: [{
      id: 360970,
      title: '《春明梦忆》毛边本',
      desc: '梨园大家翁偶虹先生笔下的老北京吃喝玩乐',
      img: 'http://www.kfzimg.com/G07/M00/07/41/q4YBAFyLHN-AaTXHAAEJqxDBPok342_n.jpg',
      tags: ['毛边本'],
      price: 98.00,
      freeMail: true
    }, {
      id: 360971,
      title: '《西洋镜：海外史料看李鸿章（上下）》毛',
      desc: '来自115年前的西方媒体观察，欧美记者28万字报道，200张珍贵影像还原一个真实的李鸿章',
      img: 'http://www.kfzimg.com/G07/M00/2A/92/qoYBAFyLHHyAM8eLAAD8n-H1QJ8261_n.jpg',
      tags: ['毛边本'],
      price: 198.00,
      freeMail: true
    }, {
      id: 360972,
      title: '止庵签名钤印《让一切光源都熄灭：沙鸥诗',
      desc: '深挚、幽美、奇逸的诗篇，穿越时空的电光石火，“中国新诗百年”终身成就奖获得者沙鸥作品全新',
      img: 'http://www.kfzimg.com/G07/M00/23/05/qoYBAFyAuY-AIpNNAAEVA0QKsKY961_n.jpg',
      tags: ['签名', '钤印', '毛边本'],
      price: 68.00,
      freeMail: true
    }],
    msg: ''
  })

  Mock.mock('/api/book/older', 'get', {
    code: 0,
    data: [{
      id: 764928,
      title: '戴望舒名作欣赏',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/user/0/afa4/afa44f6175d960f80ee95ac049a903b6_0_0_0_0.jpg',
      auther: '戴望舒 著；孙玉石 主编',
      price: '2.00'
    }, {
      id: 764929,
      title: '王国维全集',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/isbn/0/b248/b248b6d425de1df857464fb3bfb2b114_0_0_0_0.jpg',
      auther: '王国维 著；谢维扬、房鑫亮 主编',
      price: '170.00'
    }, {
      id: 764930,
      title: '现代吴语的研究',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/isbn/0/a3d5/a3d5ef60569b2ee497b39b667ae32f0b_0_0_0_0.jpg',
      auther: '赵元任 著',
      price: '17.94'
    }, {
      id: 764931,
      title: '隋唐制度渊源略论稿 唐代政治史述论稿',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/isbn/0/3dbf/3dbf6605464551c3fd863fdb7c6beddc_0_0_0_0.jpg',
      auther: '陈寅恪 著',
      price: '39.88'
    }, {
      id: 764932,
      title: '读书指南',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/user/0/b747/b7476c3be6fced45dfd11136fd90bade_0_0_0_0.jpg',
      auther: '梁启超 著',
      price: '5.00'
    }, {
      id: 764933,
      title: '王维集校注（全四册）',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/isbn/0/e5c3/e5c37c716dd395760f38c238d1424cce_0_0_0_0.jpg',
      auther: '[唐]王维 撰；陈铁民 校注',
      price: '15.00'
    }, {
      id: 764934,
      title: '经史百家杂钞',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/isbn/0/5212/5212ea2111d539e31a80cad6f89b167d_0_0_0_0.jpg',
      auther: '曾国藩 著',
      price: '20.00'
    }, {
      id: 764935,
      title: '林和靖集',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/isbn/0/a5dd/a5ddd0acf0af0aae7a00eeca0fc6fb98_0_0_0_0.jpg',
      auther: '[宋]林逋 著；沈幼征 译',
      price: '88.00'
    }, {
      id: 764936,
      title: '随园食单',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/isbn/0/116c/116c76f7f1838ceaa689f9daa4f2bff0_0_0_0_0.jpg',
      auther: '[清]袁枚 著',
      price: '10.00'
    }, {
      id: 764937,
      title: '苏轼诗词选',
      img: 'http://booklibimg.kfzimg.com/data/book_lib_img_v2/isbn/0/33e6/33e69cc5114d286bbeae0a8951ecbbb1_0_0_0_0.jpg',
      auther: '孔凡礼、刘尚荣 注',
      price: '32.00'
    }],
    msg: ''
  })

  Mock.mock('/api/store/older', 'get', {
    code: 0,
    'data|10': [{
      id: '@increment()',
      title: '@cword(3, 10)',
      desc: '@cword(10, 20)'
    }],
    msg: ''
  })

  Mock.mock('/api/book/newly', 'get', {
    code: 0,
    'data|10': [{
      id: '@increment',
      title: '@cword(5,10)',
      img: '@image(165x240)',
      auther: '@cname() 著',
      price: '@float(10, 999, 2, 2)'
    }],
    msg: ''
  })

  Mock.mock('/api/store/newly', 'get', {
    code: 0,
    'data|10': [{
      id: '@increment()',
      title: '@cword(3, 10)',
      desc: '@cword(10, 20)'
    }],
    msg: ''
  })

  Mock.mock('/api/book/tracingOldBook', 'get', {
    code: 0,
    'data|10': [{
      id: '@increment',
      title: '@cword(5,10)',
      img: '@image(165x240)',
      auther: '@cname() 著',
      price: '@float(10, 999, 2, 2)'
    }],
    msg: ''
  })

  Mock.mock('/api/store/tracingOldBook', 'get', {
    code: 0,
    'data|10': [{
      id: '@increment()',
      title: '@cword(3, 10)',
      desc: '@cword(10, 20)'
    }],
    msg: ''
  })
}
